<script setup>
import FirstTitle from "@comp/FirstTitle";
import { onMounted } from "vue";
import PsbzTable from "@comp/llyy/PsbzTable";
import { postTableData } from "@/api/table";

const city = window.globalObj.name;

const zhjgHeaders = [
  {
    label: "行政区划",
    prop: "jd_name",
    minWidth: "90",
  },
  {
    label: "工程名称",
    prop: "name",
    minWidth: "90",
  },
  {
    label: "工程类型",
    prop: "type",
    minWidth: "300",
  },
  {
    label: "建设地点",
    prop: "detailed_address",
    minWidth: "90",
  },
  {
    label: "工程类别",
    prop: "build_classify",
    minWidth: "90",
  },
  {
    label: "状态",
    prop: "code",
    minWidth: "90",
  },
  {
    label: "使用面积（平方米）",
    prop: "usable_area",
    minWidth: "90",
  },
  {
    label: "建筑面积（平方米）",
    prop: "covered_area",
    minWidth: "90",
  },
  {
    label: "容纳人数",
    prop: "wartime_shelter",
    minWidth: "90",
  },
  {
    label: "口部数",
    prop: "oral_number",
    minWidth: "90",
  },
];

const zhjgList = ref([
  {
    data0: "X",
    data1: "X",
    data2: "X",
    data3: "X",
    data4: "X",
    data5: "X",
    data6: "X",
    data7: "X",
    data8: "X",
    data9: "X",
  },
]);
const ssdyHeaders = [
  {
    label: "序号",
    prop: "rowNum",
    minWidth: "90",
  },
  {
    label: "行政区划（域）",
    prop: "jd_name",
    minWidth: "90",
  },
  {
    label: "疏散地域名称",
    prop: "name",
    minWidth: "300",
  },
  {
    label: "面积(km²)",
    prop: "area",
    minWidth: "90",
  },
  {
    label: "包含村庄",
    prop: "villages",
    minWidth: "90",
  },
  {
    label: "当地人口数量(人)",
    prop: "local_population",
    minWidth: "90",
  },
  {
    label: "接收人口数量(人)",
    prop: "accept_population",
    minWidth: "90",
  },
  {
    label: "接收单位联系人",
    prop: "rf_contact",
    minWidth: "90",
  },
  {
    label: "联系电话",
    prop: "rf_contact_phone",
    minWidth: "90",
  },
];

const ssdyList = ref([
  {
    data0: "X",
    data1: "X",
    data2: "X",
    data3: "X",
    data4: "X",
    data5: "X",
    data6: "X",
    data7: "X",
    data8: "X",
  },
]);
const ybcsHeaders = [
  {
    label: "行政区划（域）",
    prop: "jd_name",
    minWidth: "90",
  },
  {
    label: "掩蔽场所名称",
    prop: "name",
    minWidth: "90",
  },
  {
    label: "面积(㎡)",
    prop: "area",
    minWidth: "300",
  },
  {
    label: "掩蔽人员数量(人)",
    prop: "accommodate",
    minWidth: "90",
  },
  {
    label: "类型",
    prop: "type",
    minWidth: "90",
  },
  {
    label: "联系人",
    prop: "rf_contact",
    minWidth: "90",
  },
  {
    label: "联系电话",
    prop: "rf_contact_phone",
    minWidth: "90",
  },
];

const ybcsList = ref([
  {
    data0: "X",
    data1: "X",
    data2: "X",
    data3: "X",
    data4: "X",
    data5: "X",
    data6: "X",
  },
]);
const zydHeaders = [
  {
    label: "序号",
    prop: "rowNum",
    minWidth: "90",
  },
  {
    label: "专业队名称",
    prop: "type_x",
    minWidth: "90",
  },
  {
    label: "类型",
    prop: "type",
    minWidth: "300",
  },
  {
    label: "分队类型",
    prop: "type_b",
    minWidth: "90",
  },
  {
    label: "牵头单位",
    prop: "qtdw",
    minWidth: "90",
  },
  {
    label: "组建单位",
    prop: "unit",
    minWidth: "90",
  },
  {
    label: "人员数量",
    prop: "num",
    minWidth: "90",
  },
];

const zydList = ref([
  {
    data0: "X",
    data1: "X",
    data2: "X",
    data3: "X",
    data4: "X",
    data5: "X",
    data6: "X",
    data7: "X",
  },
]);
const zydwHeaders = [
  {
    label: "行政区域",
    prop: "jd_name",
    minWidth: "90",
  },
  {
    label: "专业队类型",
    prop: "type_b",
    minWidth: "90",
  },
  {
    label: "分类型",
    prop: "type_x",
    minWidth: "90",
  },
  {
    label: "组建数量",
    prop: "zjNum",
    minWidth: "300",
  },
  {
    label: "扩编比例",
    prop: "kbbl",
    minWidth: "90",
  },
  {
    label: "扩编数量",
    prop: "kbNum",
    minWidth: "90",
  },
  {
    label: "扩编后数量",
    prop: "kbrs",
    minWidth: "90",
  },
  {
    label: "扩编后建制",
    children: [
      {
        label: "支队",
        prop: "ying",
        minWidth: "90",
      },
      {
        label: "大队",
        prop: "lian",
        minWidth: "90",
      },
      {
        label: "中队",
        prop: "pai",
        minWidth: "90",
      },
      {
        label: "小队",
        prop: "ban",
        minWidth: "90",
      },
    ],
  },
  {
    label: "牵头单位",
    prop: "qtdw",
    minWidth: "90",
  },
  {
    label: "备注",
    prop: "data11",
    minWidth: "90",
  },
];

const zydwList = ref([
  {
    data0: "X",
    data1: "X",
    data2: "X",
    data3: "X",
    data4: "X",
    data5: "X",
    data6: "X",
    data7: "X",
    data8: "X",
    data9: "X",
    data10: "X",
    data11: "X",
  },
]);
const zbdyHeaders = [
  {
    label: "动员分类",
    prop: "dydwlx",
    minWidth: "90",
  },
  {
    label: "任务内容",
    prop: "zbdynr",
    minWidth: "300",
  },
  {
    label: "范围规模",
    prop: "fwglm",
    minWidth: "300",
  },
  {
    label: "动员时限",
    prop: "dysx",
    minWidth: "90",
  },
  {
    label: "程序方式",
    prop: "zzfs",
    minWidth: "90",
  },
];

const zbdyList = ref([
  {
    data0: "X",
    data1: "X",
    data2: "X",
    data3: "X",
    data4: "X",
  },
]);
const lzxlHeaders = [
  {
    label: "时间",
    prop: "lzxljd",
    minWidth: "90",
  },
  {
    label: "参训人员",
    prop: "lzxldwlx",
    minWidth: "120",
  },
  {
    label: "任务内容",
    prop: "lzxlnr",
    minWidth: "300",
  },
  {
    label: "时限",
    prop: "lzxlqx",
    minWidth: "300",
  },
  {
    label: "组织方式",
    prop: "lzxlzzxs",
    minWidth: "300",
  },
];

const lzxlList = ref([
  {
    data0: "X",
    data1: "X",
    data2: "X",
    data3: "X",
  },
]);

// 重点人防工程统计表
const getBcData = () => {
  return postTableData({
    docType: "spaceToWar",
    method: "zhongdianrenfanggongcheng",
  }).then((res) => {
    if (res.code === 200) {
      zhjgList.value = res?.data || [];
    }
  });
};
// 疏散地域统计表
const getSsData = () => {
  return postTableData({
    docType: "spaceToWar",
    method: "shusandiyutongji",
  }).then((res) => {
    if (res.code === 200) {
      ssdyList.value = res?.data || [];
    }
  });
};
// 掩蔽场所统计表
const getYbData = () => {
  return postTableData({
    docType: "spaceToWar",
    method: "zhebichangsuototalList",
  }).then((res) => {
    if (res.code === 200) {
      ybcsList.value = res?.data || [];
    }
  });
};
// 专业队统计表
const getTjData = () => {
  return postTableData({
    docType: "spaceToWar",
    method: "zhuanyeduitongji",
  }).then((res) => {
    if (res.code === 200) {
      zydList.value = res?.data || [];
    }
  });
};
// 专业队伍扩编计划表
const getKbData = () => {
  return postTableData({
    docType: "spaceToWar",
    method: "zhuanyeduikuobian",
  }).then((res) => {
    if (res.code === 200) {
      zydwList.value = res?.data || [];
    }
  });
};
// 战备动员计划表
const getZbData = () => {
  return postTableData({
    docType: "spaceToWar",
    method: "zhanbeidongyuanPlan",
  }).then((res) => {
    if (res.code === 200) {
      zbdyList.value = res?.data || [];
    }
  });
};
// 临战训练计划表
const getLzData = () => {
  return postTableData({
    docType: "spaceToWar",
    method: "linzhanxunlianPlan",
  }).then((res) => {
    if (res.code === 200) {
      lzxlList.value = res?.data || [];
    }
  });
};

onMounted(async () => {
  await getBcData();
  await getSsData();
  await getYbData();
  await getTjData()
  await getKbData()
  await getZbData()
  await getLzData()


});
</script>
<template>
  <div class="">
    <FirstTitle :name="city + '平战转换工作流程图'" />
    <div class="img-box top-15 flex-justify-center-center">
      <img src="@/assets/img/pzzh/twotoone.png" />
    </div>
    <div class="img-box top-15 flex-justify-center-center">
      <img src="@/assets/img/pzzh/pingtothree.png" />
    </div>
    <div class="img-box top-15 flex-justify-center-center">
      <img src="@/assets/img/pzzh/threetotwo.png" />
    </div>
    <FirstTitle :name="city + '重点人防工程统计表'" class="top-15" />
    <PsbzTable :headers="zhjgHeaders" :tableData="zhjgList" />
    <FirstTitle :name="city + '疏散地域统计表'" class="top-15" />
    <PsbzTable :headers="ssdyHeaders" :tableData="ssdyList" />
    <FirstTitle :name="city + '掩蔽场所统计表'" class="top-15" />
    <PsbzTable :headers="ybcsHeaders" :tableData="ybcsList" />
    <FirstTitle :name="city + '专业队统计表'" class="top-15" />
    <PsbzTable :headers="zydHeaders" :tableData="zydList" />
    <FirstTitle :name="city + '专业队伍扩编计划表'" class="top-15" />
    <PsbzTable :headers="zydwHeaders" :tableData="zydwList" />
    <FirstTitle :name="city + '战备动员计划表'" class="top-15" />
    <PsbzTable :headers="zbdyHeaders" :tableData="zbdyList" />
    <FirstTitle :name="city + '临战训练计划表'" class="top-15" />
    <PsbzTable :headers="lzxlHeaders" :tableData="lzxlList" />
  </div>
</template>
<style scoped lang="scss"></style>